/**
 * Copyright 2018 人人开源 http://www.renren.io
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

package io.renren.dao;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import io.renren.entity.StudentEntity;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 用户
 *
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2017-03-23 15:22:06
 */
public interface StudentDao extends BaseMapper<StudentEntity> {

    /***
     * 获取学员信息
     * @param studentId 学员id
     * @return
     */
    Map<String, Object> getStudentMap(@Param("studentId") Long studentId);


    /***
     * 获取学员的科目
     * @param studentId 学生id
     * @return
     */
    List<Map<String, Object>> getSubjectList(@Param("studentId") Long studentId);

    /***
     * 获取学校信息
     * @param schoolId 学校id
     * @return R
     */
    Map<String, Object> getSchoolInfo(@Param("schoolId") Integer schoolId);

    /**
     * 使用手机或者身份证号码作为账号
     *
     * @param account 账号(手机,身份证)
     * @return
     */
    StudentEntity getLoginStudent(String account);

    /**
     * 获取学校列表
     *
     * @return R
     */
    List<Map<String, Object>> getSchoolList();

    /***
     *小程序
     * 获取一键报名科目id
     * @param type 科目类别:1人社 2交通 3安监
     * @param subjectName 科目名称
     * @return
     */
    List<Map<String, Object>> getSignUpSubjectList(@Param("type") Integer type, @Param("subjectName") String subjectName);


    /***
     *
     * 新增一键报名信息
     *
     * @param realName 真实姓名
     * @param phone 手机
     * @param idCard 身份证
     * @param subjectId 科目id
     * @param subjectName 科目名称
     */
    void insertSignUpRecord(@Param("realName") String realName, @Param("phone") String phone, @Param("idCard") String idCard, @Param("subjectId") Integer subjectId, @Param("subjectName") String subjectName);

    /***
     * 小程序
     * 获取证件信息
     * @param studentId 学员id
     * @param schoolId 学校id
     * @return
     */
    List<Map<String, Object>> getCertificate(@Param("studentId") Long studentId, @Param("schoolId") Integer schoolId);


    /***
     * 小程序
     * 获取科目名称(一键报名用)
     * @param subjectId 科目id
     * @return
     */
    String getSubjectName(@Param("subjectId") Integer subjectId);


    /***
     * 小程序
     * 获取我的订单
     * @param studentId 学员id
     * @return R
     */
    List<Map<String, Object>> getOrderList(@Param("studentId") Long studentId);

    /***
     * 获取个人中心信息
     * @param studentId 学员id
     * @return
     */
    Map<String,Object> getCenterInfo(Long studentId);
}
